package com.comp3111.happymeal;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class FollowingPageActivity extends NavigationDrawerActivity {
	
	private ListView listView;
    private SimpleAdapter adapter;
    private ListView listView2;
    private SimpleAdapter adapter2;
    private ListView listView3;
    private SimpleAdapter adapter3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.following_page);
        createDrawer();
        listView = (ListView)findViewById(R.id.listView);
        adapter = new SimpleAdapter(this, getData(), R.layout.comment_restaurant_listview,
				new String[]{"user_review_pic","brief_description","time", "comments", "user_rating"},
				new int[]{R.id.user_review_pic, R.id.brief_description, R.id.time, R.id.comments, R.id.user_rating});
        listView.setAdapter(adapter);
        
        listView2 = (ListView)findViewById(R.id.listView2);
        adapter2 = new SimpleAdapter(this, getData2(), R.layout.comment_food_listview,
				new String[]{"user_review_pic","brief_description","time", "comments", "love_pic"},
				new int[]{R.id.user_review_pic, R.id.brief_description, R.id.time, R.id.comments, R.id.love_pic});
        listView2.setAdapter(adapter2);
        
        listView3 = (ListView)findViewById(R.id.listView3);
        adapter3 = new SimpleAdapter(this, getData3(), R.layout.love_food_listview,
				new String[]{"user_review_pic","brief_description","time"},
				new int[]{R.id.user_review_pic, R.id.brief_description, R.id.time});
        listView3.setAdapter(adapter3);
    }
    private List<Map<String, Object>> getData() {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("user_review_pic", R.drawable.profile_pic_2);
		map.put("brief_description", "Kim Sung commented a restaurant");
		map.put("time", "29/3/2014 11:28PM");
		map.put("comments", "The restaurant is good. The staff are nice.");
		map.put("user_rating", "Rating: 5/5");
		list.add(map);
		
		return list;
	}
    private List<Map<String, Object>> getData2() {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("user_review_pic", R.drawable.profile_pic_2);
		map.put("brief_description", "Kim Sung commented a food");
		map.put("time", "29/3/2014 11:28PM");
		map.put("comments", "It is fatastic, delicious, good, not bad.");
		map.put("love_pic", R.drawable.love);
		list.add(map);
		
		return list;
	}
    private List<Map<String, Object>> getData3() {
		List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("user_review_pic", R.drawable.profile_pic_2);
		map.put("brief_description", "Kim Sung loved Baby Mac");
		map.put("time", "29/3/2014 11:28PM");
		list.add(map);
		
		return list;
	}
}